package ace.module.account.sdk.core.feign.impl;

import ace.cmp.core.model.R;
import ace.cmp.openfeign.security.oauth2.core.config.FeignInternalServerOauth2SecurityConfig;
import ace.module.account.api.model.config.IamAccountBaseConfig;
import ace.module.account.sdk.core.feign.IamApplicationConfigFeignApi;
import ace.module.common.api.annotation.ApiRemoteProxyPriority;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ace.module.account.sdk.core.constant.SdkConstant;

/**
 * @author Caspar
 */
@FeignClient(
    name = "${spring.cloud.openfeign.client.config.iamApplicationConfigFeign.name:" + SdkConstant.FEIGN_SERVICE_NAME + "}",
    contextId = "iamApplicationConfigFeign",
    path = IamApplicationConfigFeign.PATH,
    configuration = FeignInternalServerOauth2SecurityConfig.class,
    primary = false
)
@ApiRemoteProxyPriority
public interface IamApplicationConfigFeign extends IamApplicationConfigFeignApi {
  String PATH = "${spring.cloud.openfeign.client.config.iamApplicationConfigFeign.path:/account/iam-application-config/rpc}";

  @GetMapping("/getBaseConfig")
  R<IamAccountBaseConfig> getBaseConfig(
      @Valid @NotNull @RequestParam("appBizTypeId") Long appBizTypeId);
}
